import Vue from 'vue'
import Vuex from "vuex"

Vue.use(Vuex)

const store = new Vuex.Store({
    state:{
        fileTreeActiveKey:{'good1': true}
    },
    mutations:{
        newFileTreeActiveKey(state, key) {
            state.fileTreeActiveKey = {}
            state.fileTreeActiveKey[key] = true
        },
        addFileTreeActiveKey(state, key) {
            state.fileTreeActiveKey[key] = true
        },
        delFileTreeActiveKey(state, key) {
            state.fileTreeActiveKey[key] = false
        },
        toggleFileTreeActiveKey(state, key) {
            state.fileTreeActiveKey[key] = !state.fileTreeActiveKey[key]
        },
        clearFileTreeActiveKey(state){
            state.fileTreeActiveKey = {}
        }
    },
    actions:{},
    modules:{}
})

export default store 